package com.example.forum2.Service;

import com.example.forum2.model.Article;
import com.example.forum2.model.ArticleReply;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IArticleService {
    @Transactional
    void create(Article article);
    List<Article> selectAll();
    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);
    Article selectDetailById(Long id);
    void modify(Long id,String title,String content);
    Article selectById(Long id);
    void thumbsUpById(Long id);
    @Transactional
    void deleteById(Long id);
    /**
     * 帖⼦数加
     * * @param id
     * * @return
     */
    void addOneArticleCountById(Long id);
    void addOneReplyCountById(Long id);
    /**
     * 根据⽤⼾Id查询帖⼦列表以发布时间降序排列
     * * @param userId ⽤⼾Id
     * @return ⽤⼾发布的帖⼦集合 */
    List<Article> selectByUserId(@Param("userId") Long userId);
}
